<template>
  <div class="container">
    <div class="content">
      <el-tag type="danger">我的排名: {{currentLeader}}</el-tag>
      <div class="leader-info">
        <div class="leader-item clear-float" v-for="(item,index) in leaderList" :key="index">
          <ul :class="{Action: (index+1) === 4}" class="clear-float">
            <li class="score-l">{{index + 1}}</li>
            <li class="score-m">{{item.name}}</li>
            <li class="score-r">{{item.score}}</li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        name: "LeaderBoarder",
        currentLeader: 4,
      }
    },
    computed: {
      leaderList() {
        return this.$store.state.leaderboarder.leaderList;
      },
      isMe(index) {
        return index === this.currentLabel;
      }
    },
    mounted(){


    }
  }
</script>

<style scoped>
  .container {
    height: 100%;
    width: 100%;
    /*background-color: silver;*/
  }

  .content {
    padding: 20px;
  }

  .el-tag {
    width: 120px;
    font-size: 16px;
    border-radius: 30px;
    background-color: #FF6666;
    color: white;
    height: 2em;
    font-weight: bolder;
    cursor: pointer;
    display: block;
    margin: 0 auto;
  }

  .el-tag:hover {
    opacity: 0.6;
  }

  .leader-info {
    width: 100%;
    border: 3px #FF9999 solid;
    /*height: 300px;*/
    border-radius: 10px;
    background-color: white;
    margin: 10px 0;
  }

  .leader-item {
    width: 90%;
    margin: 10px auto;
  }

  .leader-item ul {
    list-style: none;
    width: 100%;
    padding: 0;
    border-radius: 10px;
    background-color: rgba(255, 204, 161, 0.3);
    cursor: pointer;
  }

  .leader-item ul li {
    display: inline-block;
    font-size: 20px;
    height: 30px;
    padding-top: 10px;
  }

  .score-l {
    width: 20%;
    float: left;
  }

  .score-m {
    width: 50%;
    float: left;
    text-align: left;
    color: #FF9966;
    padding-left: 10px;
    font-weight: bolder;
  }

  .score-r {
    text-align: center;
    float: left;
  }

  .leader-item ul:hover {
    color: white;
    background-color: silver;
  }

  .Action {
    box-shadow: 2px 4px 2px 3px silver;
    border-radius: 0;
    background-color: yellow;
  }
</style>
